package com.zmx.doctor.adapter;

import android.app.Activity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.bumptech.glide.Glide;
import com.wang.adapters.adapter.BaseAdapterRvList;
import com.wang.adapters.base.BaseViewHolder;
import com.zmx.doctor.R;
import com.zmx.doctor.pojo.Patients;
import com.zmx.doctor.pojo.Trip;

import butterknife.BindView;
import butterknife.ButterKnife;
import de.hdodenhof.circleimageview.CircleImageView;

/**
 * 程序猿：胖胖祥
 * 时 间：2020/7/22  14:29
 * 功 能：
 */
public class PatientsAdapter extends BaseAdapterRvList<PatientsAdapter.ViewHolder, Patients> {


    public PatientsAdapter(Activity activity) {
        super(activity);
    }

    @Override
    protected void onBindVH(ViewHolder holder, int listPosition, Patients patients) {

        Glide.with(mActivity).load(patients.getAvatar()).into(holder.head);
        holder.name.setText(patients.getName()+"("+patients.getGroup_name()+")");

    }

    @NonNull
    @Override
    protected ViewHolder onCreateVH(ViewGroup parent, LayoutInflater inflater) {
        PatientsAdapter.ViewHolder holder = new PatientsAdapter.ViewHolder(inflater.inflate(R.layout.adapter_patients, parent, false));
        return holder;
    }

    static class ViewHolder extends BaseViewHolder {

        @BindView(R.id.heads)
        CircleImageView head;
        @BindView(R.id.name)
        TextView name;

        ViewHolder(View view) {
            super(view);
            ButterKnife.bind(this, view);
        }

    }


}
